package
{
	
	public class GameState extends Object
	{
		
		private var currentStateID:int = 1;
		public static const PAUSED_STATE_ID:int = 0;
		public static const IN_PLAY:int = 1;
		
		public function GameState()
		{
			
			super();
			
		}
		
		public function get state():void
		{
			
			return this.currentStateID;
			
		}
		
		public function set state(newID:int):void
		{
			
			this.currentStateID = newID;
			
		}
		
		public function getCurrentGameState():int
		{
			
			if (hasActivePauseModule)
			{
				
				state = 0;
				
			} else {
				
				state = 1;
				
			}
			
			return state;
			
		}
		
		public function hasActivePauseModule():Boolean
		{
			
			var pm:PauseModule = null;
			
				if (pm.isActive && !(pm == null) && pm is PauseModule)
				{
					
					return true;
					
				} else {
					
					return false;
					
				}
				
				if (pm.numChildren > 0 && pm is PauseModule)
				{
					
					return true;
					
				}
		}
	}
}
	